/**
 * Application-wide type definitions
 */

/**
 * Multimodal input interface for handling different types of inputs
 */
export interface MultimodalInput {
    id: string;
    text?: string;
    images?: Array<File | string>;
    audio?: Blob | string;
    video?: File | string;
    timestamp: number;
    contextId?: string;
}

/**
 * Processing options for media files
 */
export interface ProcessingOptions {
    // Image processing options
    image?: {
        maxWidth?: number;
        maxHeight?: number;
        quality?: number;
        format?: 'jpeg' | 'png' | 'webp';
    };

    // Audio processing options
    audio?: {
        sampleRate?: number;
        channels?: number;
        bitRate?: number;
        format?: 'mp3' | 'aac' | 'wav';
    };

    // Video processing options
    video?: {
        maxSize?: number;
        quality?: 'low' | 'medium' | 'high';
        maxDuration?: number;
        maxBitrate?: number;
        outputFormat?: 'mp4' | 'mov' | 'webm';
        includeAudio?: boolean;
        audioBitrate?: number;
        frameRate?: number;
    };
}

/**
 * API Response types
 */
export interface APIResponse<T = any> {
    success: boolean;
    data?: T;
    error?: {
        code: string;
        message: string;
        details?: any;
    };
}

/**
 * Chat message interface
 */
export interface ChatMessage {
    id: string;
    role: 'user' | 'assistant' | 'system';
    content: Array<{
        type: 'text' | 'image' | 'audio' | 'video';
        text?: string;
        image?: string;
        audio?: string;
        video?: string;
    }>;
    timestamp: number;
}

/**
 * Chat context/conversation
 */
export interface ChatContext {
    id: string;
    title: string;
    messages: ChatMessage[];
    createdAt: number;
    updatedAt: number;
    systemPrompt?: string;
}

/**
 * User preferences
 */
export interface UserPreferences {
    theme: 'light' | 'dark' | 'system';
    fontSize: 'small' | 'medium' | 'large';
    language: string;
    speechRate: number;
    speechVolume: number;
    autoplayAudio: boolean;
    notifications: boolean;
    saveHistory: boolean;
}

/**
 * Application state
 */
export interface AppState {
    currentContext: string | null;
    contexts: Record<string, ChatContext>;
    preferences: UserPreferences;
    apiKey: string | null;
    isProcessing: boolean;
}

/**
 * Media File Info
 */
export interface MediaFileInfo {
    uri: string;
    name: string;
    type: string;
    size: number;
    width?: number;
    height?: number;
    duration?: number;
} 